package net.zjitc.summary.user;

import java.util.Objects;

/**
 * @Author admin
 * @Date 2019/4/16 14:14
 * 关于用户的方法：
 * 1）基本方法：都写在标准类（实体类）
 * 2）特殊方法：写在工具类
 * <p>
 * 标准类（实体类）
 * 属性
 * 方法：set/get方法、构造方法（重载）、
 * 有需要的话重写toString()方法、equals()\hashCode()
 */
public class User {
    private String name;
    private String password;
    private String email;

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name) &&
                Objects.equals(password, user.password) &&
                Objects.equals(email, user.email);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, password, email);
    }

    public User(String s, String s1) {
    }

    public User(String name, String password, String email) {
        this.name = name;
        this.password = password;
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
